{$CLEO .cs}

//-------------MAIN---------------
0000: NOP 
thread "ARZ" 
repeat
wait 0
for 0@ = 0 to 9 step 1
    0085: tmi_offset = 0@
    tmi_offset *= 4
    0AC6: tm_addres = label @PARTS_HANDLE offset                                                                                                
    005a: tm_addres += tmi_offset                                                                                                                            
    0A8D: 3@ = read_memory tm_addres size 4 virtual_protect 0
    if actor.Driving($PLAYER_ACTOR)
    jf continue
    29@ = actor.CurrentCar($player_actor)                                                                                   
    if 056E:   car 29@ defined                                                                                                             
    then                                                                                                                                  
        if car.Wrecked(29@)                                                                                                                
        then                                                                                                                              
            if 03ca:   actor 3@ defined                                                                                                   
            then object.RemoveReferences(3@)                                                                                              
            end                                                                                                                           
        end                                                                                                                               
    end                                                                                                                                   
    IF 03ca:   actor 3@ defined                                                                                                           
    THEN                                                                                                                                  
        24@ = OBJECT.Model(3@)                                                                                                            
        IF 24@ == 2985                                                                                                                    
        THEN                                                                                                                            
            if Actor.Driving($PLAYER_ACTOR)                                                                                               
            THEN 29@ = Actor.CurrentCar($PLAYER_ACTOR)                                                                                     
                if 00E1:   player 0 pressed_key 4                                                                                         
                THEN                                                                                                                      
                    //// printstring "====================================================================="
                    0400: store_coords_to 8@ 17@ 18@ from_car 3@ with_offset 0.0 0.0 1.0                                                  
                    0208: 19@ = random_float_in_ranges -2.6 2.6                                                                           
                    0208: 20@ = random_float_in_ranges -2.6 2.6                                                                           
                    0400: store_coords_to 5@ 6@ 7@ from_car 3@ with_offset 200.4 19@ 20@                                                  
                    06BC: create_M4_shoot_from 8@ 17@ 18@ target 5@ 6@ 7@ energy 500                                                      
                    066E: create_particle "GUNFLASH" attached_to_object 3@ with_offset 0.8 0.0  1.1 rotation  0.866024961519 0 0.500000766025 flag 1 handle_ 19@                               
                    064C: make_particle 19@ visible                                                                                                           
                    064F: remove_references_to_particle 19@                                                                      
                    097B: play_audio_at_object 3@ event 1157                                                                              
                    //// printstring "====================================================================="                                                     
                END                                                                                                                            
            END                                                                                                                           
        END                                                                                                                               
        0AC6: tm_addres = label @PARTS_HANDLE offset                                                                                                  
        005a: tm_addres += tmi_offset                                                                                                                                      
        0A8D: 3@ = read_memory tm_addres size 4 virtual_protect 0                                                                               
        IF 03ca:   actor 3@ defined                                                                                                       
        THEN  //0acd: "1" 100                                                                                                                            
            24@ = OBJECT.Model(3@)                                                                                                        
            IF 24@ == 359 //rocket                                                                                                        
            THEN //0acd: "2" 100 
                if Actor.Driving($PLAYER_ACTOR)                                                                                               
                THEN
                    0AC6: tm_addres = label @mem_swith offset                                                                                                  
                    005a: tm_addres += tmi_offset                                                                                                                                      
                    0A8D: 26@ = read_memory tm_addres size 4 virtual_protect 0
                    //0513: show_text_box_1number 'SLOT_02' number 26@  // ~k~~VEHICLE_ENTER_EXIT~ Usar o Caa Nqueis $~1~
             
                    if and
                        00E1:   player 0 pressed_key 17
                        26@ == 0                                                                                         
                    THEN 
                    33@ = 0
                        0400: store_coords_to 22@ 23@ 24@ from_object  3@ with_offset 0.0 0.0 0.0           
                        1@ = Object.Create(1582, 22@, 23@, 24@)
                        2@ = Object.Create(#MISSILE, 22@, 23@, 24@)
                        //0681: attach_object 1@ to_car 29@ with_offset 0.0 -1.0 -0.1 rotation 0.0 0.0 0.0 
                        //0682: detach_object 1@ 0.0 0.0 0.0 collision_detection 1 
                        069A: attach_object 2@ to_object 1@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0 
                        04D9: object 1@ set_scripted_collision_check 1 
                        0906: set_object 1@ mass_to 7.5 // float 
                        0908: set_object 1@ turn_mass_to 750.0 // float 
                        08D2: object 1@ scale_model 0.1 
                        Object.ToggleInMovingList(1@) = True
                        0750: set_object 1@ visibility 0 
                        Object.SetImmunities(1@, 1, 1, 1, 1, 1)
                        08D2: object 2@ scale_model 1.0 
                        Object.CollisionDetection(2@) = False
                        Object.SetImmunities(2@, 1, 1, 1, 1, 1)
                        05A1: set_object 1@ rotation_velocity_about_an_axis 0.0 0.0 0.0 through_center_of_body 
                        05A2: set_object 1@ rotation_velocity_about_an_axis 0.0 0.0 0.0 through_center_of_mass
                        IF 03CA:   object  3@ exists                                                                                         
                        THEN                                                                                                                 
                        $angle = OBJECT.Angle( 3@)                                                                                              
                        $angle -= 92.0                                                                                                          
                        Object.Angle(1@) = $angle                                                                                               
                        END                 
                        0400: store_coords_to 22@ 23@ 24@ from_object 1@ with_offset 0.0 200.0 0.0 
                        0400: store_coords_to 25@ 26@ 27@ from_object 1@ with_offset 0.0 0.0 0.0 
                        0063: 22@ -= 25@ // (float) 
                        0063: 23@ -= 26@ // (float) 
                        0063: 24@ -= 27@ // (float) 
                        
                        Object.Throw(1@, 22@, 23@, 24@)
              
                        0AC6: tm_addres = label @mem_swith offset                                                                                                  
                        005a: tm_addres += tmi_offset               
                        0A8C: write_memory tm_addres size 4 value 1 virtual_protect 0
                        0AC6: tm_addres = label @rocket offset                                                                                                  
                        005a: tm_addres += tmi_offset                
                        0A8C: write_memory tm_addres size 4 value 1@ virtual_protect 0
                        0AC6: tm_addres = label @missile offset                                                                                                  
                        005a: tm_addres += tmi_offset                
                        0A8C: write_memory tm_addres size 4 value 2@ virtual_protect 0                                                                                                                                             
                    end
                end
                0AC6: tm_addres = label @mem_swith offset                                                                                                  
                005a: tm_addres += tmi_offset                                                                                                                                      
                0A8D: 26@ = read_memory tm_addres size 4 virtual_protect 0
                IF 26@ == 1                                                                                                                                         
                THEN //0acd: "0000000000000000" 100
                    0AC6: tm_addres = label @rocket offset                                                                                                
                    005a: tm_addres += tmi_offset                                                                                                                            
                    0A8D: 1@ = read_memory tm_addres size 4 virtual_protect 0
                    0AC6: tm_addres = label @missile offset                                                                                                
                    005a: tm_addres += tmi_offset                                                                                                                           
                    0A8D: 2@ = read_memory tm_addres size 4 virtual_protect 0
                    if 03CA:   object  1@ exists                                                                                                                      
                    THEN                                                                                                                                              
                        0400: store_coords_to 22@ 23@ 24@ from_object  1@ with_offset 0.0 0.0 0.0                                                                     
                        095C: create_smoke_at 22@ 23@ 24@ velocity 0.0 0.0 0.0 RGBA 1.0 0.0 1.0 1.0 size 0.2 last_factor 0.1                                          
                        0400: store_coords_to 22@ 23@ 24@ from_object 1@ with_offset 0.0 200.0 0.0 
                        0400: store_coords_to 25@ 26@ 27@ from_object 1@ with_offset 0.0 0.0 0.0 
                        0063: 22@ -= 25@ // (float) 
                        0063: 23@ -= 26@ // (float) 
                        0063: 24@ -= 27@ // (float) 
                        
                        Object.Throw(1@, 22@, 23@, 24@)                                                                                                          
                    END                                                                                                                                               
                    IF 03CA:   object  1@ exists                                                                                                                      
                    THEN                                                                                                                                              
                        if or                                                                                                                                         
                            04DA:   has_object  1@ collided                                                                                                           
                            8474:   not actor $PLAYER_ACTOR near_object_in_cube  1@ radius 200.0 200.0 100.0 sphere 0                                                 
                            33@ > 7000                                                                                                                                
                        THEN                                                                                                                                          
                            0400: store_coords_to 11@ 12@ 13@ from_object  1@ with_offset 0.0 0.0 0.0                                                                 
                            020C: create_explosion_with_radius 3 at 11@ 12@ 13@                                                                                       
                            0565: create_soundless_explosion_at 11@ 12@ 13@ type 3                                                                                    
                            Object.Destroy( 1@)                                                                                                                       
                            Object.Destroy( 2@)
                            0AC6: tm_addres = label @mem_swith offset                                                                                                  
                            005a: tm_addres += tmi_offset                
                            0A8C: write_memory tm_addres size 4 value 0 virtual_protect 0                                                                                                                         
                                                                                                                                                          
                        END                                                                                                                                           
                    END                                                                                                                                               
                END                                                                                                                                                   
                //0AB1: call_scm_func @rock_func 0
                //0AB3: var 196 = 3@  //send object handler                                                                                          
            END                                                                                                                           
        END                                                                                                                               
    END
    
END                                                                                                                                                      
until false